import HandleProxy from './Run-time';

class Eason{
  _node

  constructor() {
    this.HandleProxy = HandleProxy;
    this.create();
    this._render();
  }

  _mount(dom) {
    dom.innerHTML = this._node;
    this._dom = dom;
    this.didRender();
  }

  _render() {
    this.beforeRender();
    const newDom = this._createNode()
    this._node = newDom;
    return newDom;
  }

  _update() {
    this._render();
    this._dom.innerHTML = this._node;
    this.didRender();
  }
}

function createApp(eason, dom) {
  eason._mount(dom);
}

export {
  createApp,
  Eason
}